import request from '@/utils/request'
const api_name = '/eduservice/course'
export default {
    saveCourseInfo(courseInfo) {
        return request({
            url: `${api_name}/addCourse`,
            method: 'post',
            data: courseInfo
        })
    },
    getCourseInfoById(id) {
        return request({
            url: `${api_name}/courseInfo/${id}`,
            method: 'get'
        })
    },
    updateCourseInfoById(courseInfo) {
        return request({
            url: `${api_name}/update/${courseInfo.id}`,
            method: 'put',
            data: courseInfo
        })
    },
    getCoursePublishInfoById(id) {
        return request({
            url: `${api_name}/courseInfo/${id}`,
            method: 'get'
        })
    },
    publishCourse(id) {
        return request({
            url: `${api_name}/publish/${id}`,
            method: 'put'
        })
    },
    getPageList(size, pageSize, searchObj) {
        return request({
            url: `${api_name}/page/${size}/${pageSize}`,
            method: 'get',
            params: searchObj
        })
    },
    removeById(id) {
        return request({
            url: `${api_name}/delete/${id}`,
            method: 'delete'
        })
    }
}